package com.zz.ecommerce.searchManage.goods.preclassified;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 商品海关HS编码和税率查询
 */
@Controller
@RequestMapping("searchManage/goods")
public class GoodsSearchController {

    @Autowired
    private HsCodeService hsCodeService;

    /**
     * 跳转到初始化查询页面
     *
     * @return
     */
    @RequestMapping("/init")
    public String init() {
        return "searchManage/goods/index";
    }

    /**
     * 跳转到初始化查询页面
     *
     * @return
     */
    @RequestMapping("/initTariff")
    public String initTariff() {
        return "searchManage/tariff/index";
    }

    /**
     * 查询HS编码信息
     *
     * @param sComplex
     * @param request
     * @return
     */
    @RequestMapping("/queryHsCodeList")
    @ResponseBody
    public GridResult queryHsCodeList(SComplex sComplex, GridRequest request) {
        return hsCodeService.queryHsCodeList(request, sComplex);
    }

    /**
     * 查询出口税则信息
     *
     * @param sComplex
     * @param request
     * @return
     */
    @RequestMapping(value = "/queryTariffInfoList", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public GridResult queryTariffInfoList(STraiff sComplex, GridRequest request) {
        return hsCodeService.queryTariffInfoList(request, sComplex);
    }
}
